/**
 */
package gatperdut.chato.model.Chato.Craft.impl;

import gatperdut.chato.model.Chato.Craft.CraftPackage;
import gatperdut.chato.model.Chato.Craft.GeneratedItem;
import gatperdut.chato.model.Chato.Item.ItemTemplate;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.internal.cdo.CDOObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Generated Item</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.GeneratedItemImpl#getItemTemplate <em>Item Template</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Craft.impl.GeneratedItemImpl#getAmount <em>Amount</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class GeneratedItemImpl extends CDOObjectImpl implements GeneratedItem {
	/**
     * The default value of the '{@link #getAmount() <em>Amount</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getAmount()
     * @generated
     * @ordered
     */
	protected static final int AMOUNT_EDEFAULT = 0;

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected GeneratedItemImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return CraftPackage.Literals.GENERATED_ITEM;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected int eStaticFeatureCount() {
        return 0;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public ItemTemplate getItemTemplate() {
        return (ItemTemplate)eDynamicGet(CraftPackage.GENERATED_ITEM__ITEM_TEMPLATE, CraftPackage.Literals.GENERATED_ITEM__ITEM_TEMPLATE, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public ItemTemplate basicGetItemTemplate() {
        return (ItemTemplate)eDynamicGet(CraftPackage.GENERATED_ITEM__ITEM_TEMPLATE, CraftPackage.Literals.GENERATED_ITEM__ITEM_TEMPLATE, false, true);
    }

	/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setItemTemplate(ItemTemplate newItemTemplate) {
        eDynamicSet(CraftPackage.GENERATED_ITEM__ITEM_TEMPLATE, CraftPackage.Literals.GENERATED_ITEM__ITEM_TEMPLATE, newItemTemplate);
    }

    /**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public int getAmount() {
        return (Integer)eDynamicGet(CraftPackage.GENERATED_ITEM__AMOUNT, CraftPackage.Literals.GENERATED_ITEM__AMOUNT, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setAmount(int newAmount) {
        eDynamicSet(CraftPackage.GENERATED_ITEM__AMOUNT, CraftPackage.Literals.GENERATED_ITEM__AMOUNT, newAmount);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case CraftPackage.GENERATED_ITEM__ITEM_TEMPLATE:
                if (resolve) return getItemTemplate();
                return basicGetItemTemplate();
            case CraftPackage.GENERATED_ITEM__AMOUNT:
                return getAmount();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case CraftPackage.GENERATED_ITEM__ITEM_TEMPLATE:
                setItemTemplate((ItemTemplate)newValue);
                return;
            case CraftPackage.GENERATED_ITEM__AMOUNT:
                setAmount((Integer)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case CraftPackage.GENERATED_ITEM__ITEM_TEMPLATE:
                setItemTemplate((ItemTemplate)null);
                return;
            case CraftPackage.GENERATED_ITEM__AMOUNT:
                setAmount(AMOUNT_EDEFAULT);
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case CraftPackage.GENERATED_ITEM__ITEM_TEMPLATE:
                return basicGetItemTemplate() != null;
            case CraftPackage.GENERATED_ITEM__AMOUNT:
                return getAmount() != AMOUNT_EDEFAULT;
        }
        return super.eIsSet(featureID);
    }

} //GeneratedItemImpl
